﻿using System;
using System.Collections.Generic;
using Monkey.Warrenty.Bo;
using Monkey.Warrenty.EntityModel;
using MonkeyWarranty.Models.TicketModels;

namespace Monkey.Warrenty.Data.Interfaces
{
    public interface IInstantTicketDao
    {
        long GetCurrentIdentity();
        long GetMaxId();
        InstantTicket AddTicket(InstantTicket ticket);
        InstantTicket AddTicket(InstantTicket ticket, Customer customer);
        InstantTicket GetById(long id);
        List<InstantTicketView> GetTicketViews(int startIndex, int pageSize, string sorting, int status);
        int GetTicketCountByFilter(int statusId);
        void DeleteTicket(long id);

        void UpdateTicket(InstantTicket ticket);
        InstantTicket_Product CreateTicketProduct(InstantTicket_Product ticketProduct);
        List<InstantTicketProductView> GetTicketProducts(long ticketId);
        void DeleteTicketProduct(long ticketProductId);
        InstantTicket_Product GetTicketProductById(long id);
        void UpdateTicketProduct(InstantTicket_Product ticketProduct);
        InstantTicket_Service CreateTicketService(InstantTicket_Service ticketService);
        List<InstantTicketServiceView> GetTicketServices(long ticketId);
        void DeleteTicketService(long ticketServiceId);
        InstantTicket_Service GetTicketServiceById(long id);
        void UpdateTicketService(InstantTicket_Service ticketService);

        InstantTicket_Employee CreateTicketEmployee(InstantTicket_Employee ticketEmployee);
        List<InstantTicketEmployeeView> GetTicketEmployees(long ticketId);
        void DeleteTicketEmployee(long ticketEmployeeId);
        InstantTicket_Employee GetTicketEmployeeById(long id);
        void UpdateTicketEmployee(InstantTicket_Employee ticketEmployee);

        // printing
        InstantTicketPrintBo GetInstantTicketForPrint(long id);
        List<TaskServiceBo> GetInstantTicketTaskServiceDetails(long id);

        // reporting
        List<InstantTicketEmployeeCount> GetInstantTicketEmployeeCount(DateTime dateFrom, DateTime dateTo);

        long CopyToWarraty(long id);

        List<InstantTicketView> SearchTickets(InstantSearchModel searchModel);

        int SearchTicketsCount(InstantSearchModel searchModel);

        int SearchServicesCount(InstantServiceSearchModel search);
        List<InstantTicketServiceView> SearchServices(InstantServiceSearchModel search);

        int SearchProductsCount(InstantProductSearchModel searchModel);
        List<InstantTicketProductView> SearchProducts(InstantProductSearchModel search);

        void UpdateTicketServiceStatus(long instantServiceId, int statusId, string description, string note);

        List<InstantTicketServiceView> GetActiveTicketServiceViews(int employeeId);

        List<InstantTicketProductView> GetActiveTicketProductViews(int employeeId);

        void UpdateTicketProductStatus(long instantProductId, int statusId, string description, string note);
    }
}
